﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

/// <summary>
/// An element used in an application
/// </summary>
public class RBElement {
    private int id;
    private string name,
                   bundleID,
                   bundleName,
                   comment;
    private RBApplication application;
    private RBResource resource;

    /// <summary>
    /// Gets or sets the element's application.
    /// </summary>
    /// <value>The element's application.</value>
    public RBApplication Application {
        get { return application; }
        set { application = value; }
    }
    /// <summary>
    /// Gets or sets the ID.
    /// </summary>
    /// <value>The ID.</value>
    public int ID {
        get { return id; }
        set { id = value; }
    }
    /// <summary>
    /// Gets or sets the element name.
    /// </summary>
    /// <value>The name.</value>
    public string Name {
        get { return name; }
        set { name = value; }
    }
    /// <summary>
    /// Gets or sets the ID of the bundle in which this element is used.
    /// </summary>
    /// <value>The bundle ID.</value>
    public string BundleID {
        get { return bundleID; }
        set { bundleID = value; }
    }
    /// <summary>
    /// Gets or sets the name of the bundle in which this element is used.
    /// </summary>
    /// <value>The name of the bundle.</value>
    public string BundleName {
        get { return bundleName; }
        set { bundleName = value; }
    }
    /// <summary>
    /// Gets or sets the comment.
    /// </summary>
    /// <value>The comment.</value>
    public string Comment {
        get { return comment; }
        set { comment = value; }
    }
    /// <summary>
    /// Gets or sets the resource the element uses.
    /// </summary>
    /// <value>The resource.</value>
    public RBResource Resource {
        get { return resource; }
        set { resource = value; }
    }

    /// <summary>
    /// Initializes a new <see cref="RBElement"/>.
    /// </summary>
    public RBElement() {
        this.id = -1;
        this.name = string.Empty;
        this.bundleID = string.Empty;
        this.bundleName = string.Empty;
        this.comment = string.Empty;
        this.resource = new RBResource();
    }

    /// <summary>
    /// Initializes a new <see cref="RBElement"/>.
    /// </summary>
    /// <param name="id">The ID.</param>
    /// <param name="name">The name.</param>
    /// <param name="bundleId">The bundle ID.</param>
    /// <param name="bundleName">Name of the bundle.</param>
    /// <param name="comment">The comment.</param>
    public RBElement(int id, string name, string bundleId, string bundleName, string comment) {
        this.id = id;
        this.name = name;
        this.bundleID = bundleId;
        this.bundleName = bundleName;
        this.comment = comment;
        this.resource = new RBResource();
    }
}